package com.ruoyi.network.model.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

import static lombok.AccessLevel.PUBLIC;

/**
 * 分页参数VO
 *
 * @author lyp
 * @description: 分页参数VO
 * @date 2024-09-09 11:27:04
 * @version: 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor(access = PUBLIC)
public class PageVO implements Serializable {
    private static final int DEFAULT_PAGE = 1;
    private static final int DEFAULT_SIZE = 10;

    private Integer page;

    private Integer size;

    private String sort;

    private boolean sortType;

    private String search;

    private String order;

    public void setPage(Integer page) {
        this.page = (page == null) ? DEFAULT_PAGE : page;
    }

    public void setSize(Integer size) {
        this.size = (size == null) ? DEFAULT_SIZE : size;
    }
}
